From: Florian Müllner Date: Fri, 24 Jan 2014 15:26:49 +0000 (-0500) Subject: window-tracker: Be more cautious when setting focus app X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2728 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2663e1be5d27de6fa5ad0c0e1a23d1d2108084db;p=gnome-shell.git window-tracker: Be more cautious when setting focus app Since we started tracking non-interesting windows, we can no longer assume that if we manage to find an app associated with the focus window, it should appear focused - we now can find apps for docks, the DESKTOP window etc. To restore the old behavior, make sure that the focus window or one of its parents is "interesting". https://bugzilla.gnome.org/show_bug.cgi?id=722928 --- diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 3e0ea8332..2b8220129 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -424,6 +424,16 @@ update_focus_app (ShellWindowTracker *self) ShellApp *new_focus_app; new_focus_win = meta_display_get_focus_window (shell_global_get_display (shell_global_get ())); + + /* we only consider an app focused if the focus window can be clearly + * associated with a running app; this is the case if the focus window + * or one of its parents is visible in the taskbar, e.g. + * - 'nautilus' should appear focused when its about dialog has focus + * - 'nautilus' should not appear focused when the DESKTOP has focus + */ + while (new_focus_win && meta_window_is_skip_taskbar (new_focus_win)) + new_focus_win = meta_window_get_transient_for (new_focus_win); + new_focus_app = new_focus_win ? shell_window_tracker_get_window_app (self, new_focus_win) : NULL; if (new_focus_app)